package com.dd.cloud.user.service.chknowl.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dd.cloud.user.entity.chknowl.ChknowlBooksCategory;
import com.dd.cloud.user.mapper.chknowl.ChknowlBooksCategoryMapper;
import com.dd.cloud.user.service.chknowl.IChknowlBooksCategoryService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 书院书籍分类表 服务实现类
 * </p>
 *
 * @author czg
 * @since 2023-10-12
 */
@Service
public class ChknowlBooksCategoryServiceImpl extends ServiceImpl<ChknowlBooksCategoryMapper, ChknowlBooksCategory> implements IChknowlBooksCategoryService {

    @Override
    public List<ChknowlBooksCategory> queryBookCategoryList() {
        LambdaQueryWrapper<ChknowlBooksCategory> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(ChknowlBooksCategory::getStatus, 1)
                .orderByAsc(ChknowlBooksCategory::getSort, ChknowlBooksCategory::getCreateDate);
        return this.list(wrapper);
    }
}
